From: Owen W. Taylor Date: Tue, 7 Apr 2015 14:14:05 +0000 (-0400) Subject: Unrevert gtkactionmuxer: Reintroduce the passing of event timestamps X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~1392 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a0632e3e0214dcf43d3ed54db952154ffef33bbd;p=gnome-shell.git Unrevert gtkactionmuxer: Reintroduce the passing of event timestamps Fix an accidental revert of a6a2cea414 - a patch that hacked the cut-and-pasted code from GTK+ to pass timestamps when activating remote actions. https://bugzilla.gnome.org/show_bug.cgi?id=747323 --- diff --git a/src/gtkactionmuxer.c b/src/gtkactionmuxer.c index 8e992ea57..155e00bd8 100644 --- a/src/gtkactionmuxer.c +++ b/src/gtkactionmuxer.c @@ -24,6 +24,8 @@ #include "gtkactionobservable.h" #include "gtkactionobserver.h" +#include + #include /** @@ -413,6 +415,26 @@ gtk_action_muxer_activate_action (GActionGroup *action_group, g_action_group_activate_action (G_ACTION_GROUP (muxer->parent), action_name, parameter); } +static GVariant * +get_platform_data (void) +{ + gchar time[32]; + GVariantBuilder *builder; + GVariant *result; + + g_snprintf (time, 32, "_TIME%d", clutter_get_current_event_time ()); + + builder = g_variant_builder_new (G_VARIANT_TYPE ("a{sv}")); + + g_variant_builder_add (builder, "{sv}", "desktop-startup-id", + g_variant_new_string (time)); + + result = g_variant_builder_end (builder); + g_variant_builder_unref (builder); + + return result; +} + static void gtk_action_muxer_change_action_state (GActionGroup *action_group, const gchar *action_name, @@ -425,7 +447,15 @@ gtk_action_muxer_change_action_state (GActionGroup *action_group, group = gtk_action_muxer_find_group (muxer, action_name, &unprefixed_name); if (group) - g_action_group_change_action_state (group->group, unprefixed_name, state); + { + if (G_IS_REMOTE_ACTION_GROUP (group->group)) + g_remote_action_group_change_action_state_full (G_REMOTE_ACTION_GROUP (group->group), + unprefixed_name, + state, + get_platform_data ()); + else + g_action_group_change_action_state (group->group, unprefixed_name, state); + } else if (muxer->parent) g_action_group_change_action_state (G_ACTION_GROUP (muxer->parent), action_name, state); }